<!DOCTYPE html>
<html lang="en">
<head>
    <title>{$data.title}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="{$data.description}" />
    <meta name="keywords" content="{$data.keyword}" />
    <meta name="robots" content="all"/>
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <!-- css -->
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
    <link href="__MOBILE__css/iconfont.css" rel="stylesheet"/>
    <link href="__MOBILE__css/other/am.css" rel="stylesheet"/>
    <link href="__MOBILE__css/other/flexslider.css" rel="stylesheet"/>
    <link href="__MOBILE__css/other/style.css" rel="stylesheet"/>
    <!-- moblie -->
    <link rel="stylesheet" href="__MOBILE__css/style.css">
    {$seo.head}
</head>
<body>
{$seo.body}


<div class="m_wrap">
    {include file="public/header" /}
</div>
<!-- m_banner -->
<div class="m_banner">
    <ul class="m_banner_slider clear">
        {volist name="banner" id="v" key="k"}
        <li>
            <div class="pic">
                <img src="{$v.img_url}" alt="{$v.alt}">
            </div>
        </li>
        {/volist}
    </ul>
</div>
<div class="crumbs clear">
    <i class="iconfont icon-zhuye"></i>
    <a href="/">主页</a>>
    <a >{$data.name}</a>
</div>
<!-- m_banner end -->
<div class="_contactus">

    <div class="_form">
        <form id="Contactus_form">
            <input class="_inp_text" type="text" id="name" name="name"   placeholder="姓名 *" autocomplete="off">
            <input class="_inp_text" type="text" id="tel" name="telephone"   placeholder="手机号码*" autocomplete="off">
            <input class="_inp_text" type="text" id="com" name="company"   placeholder="公司名称" autocomplete="off">
            <input class="_inp_text" type="text" id="email" name="email"   placeholder="邮箱地址" autocomplete="off">


            <textarea class="_inp_text" id="content" type="text" name="message"   placeholder="留言内容 *" autocomplete="off"></textarea>

        </form>
        <a class="_submit" id="subMit">Submit</a>
    </div>
    <div class="_other_theway">
        <h3 class="_title _thewayh3">您也可以通过以下方式联系我们</h3>
        <div class="_theway_top">
            <ul>
                <li class="clear">
                    <a class="_contactus_item fl"><i class="iconfont icon-youxiang2"></i></a>
                    <div class="fl">
                        <h3 class="_title">邮箱</h3>
                        <p>
                            <a href="mailto:{$setup.email}">{$setup.email}</a><br>
                        </p>
                    </div>
                </li>
                <li class="clear">
                    <a class="_contactus_item fl"><i class="iconfont icon-dianhua2"></i></a>
                    <div class="fl">
                        <h3 class="_title">手机</h3>
                        <p >
                            <a href="tel:{$setup.phone}">{$setup.phone}</a>
                        </p>
                    </div>
                </li>
                <li class="clear">
                    <a class="_contactus_item fl"><i class="iconfont icon-dizhi1"></i></a>
                    <div class="fl">
                        <h3 class="_title">地址</h3>
                        <p>
                            {$setup.site}
                        </p>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</div>


{include file="public/footer" /}
<script>
    var flag = 0;
    $('#subMit').click(function(){
        if(flag==3){
            alert('Dangerous Operation!');
            return false;
        }
        var tel = $('#tel').val();

        if(!$('#name').val()){
            alert('请填写姓名!')
            return false;
        }else if(!tel){
            alert('请填写手机!')
            return false;
        }
        var email = $('#email').val();
        if(email){
            if(!email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/))
            {
                alert("请填写正确的邮箱");
                return false;
            }
        }
        $.ajax({
            type: "POST",
            dataType: "json",
            url: '/home/danye/addcontactus',
            data: {
                'name':$('#name').val(),
                'com':$('#com').val(),
                'email':$('#email').val(),
                'tel':$('#tel').val(),
                'country':'',
                'content':$('#content').val(),
                'type':1
            },
            success: function (res) {
                var success = JSON.parse(res);
                if(success.code===200){
                    flag = flag+1;
                    $('#name').val('')
                    $('#com').val('')
                    $('#email').val('')
                    $('#tel').val('')
                    $('#content').val('')

                    alert(success.msg);
                }else {
                    alert(success.msg);
                }

            }
        });

    })
</script>
<style type="text/css">
    ._contactus{margin-top: 20px;}
</style>